package org.example.entity;

/**
 * 水果超市类
 */
public class Supermarket {
    //单价
    private  double price;
    //总价
    private double totalPrice;



    public Supermarket() {

    }

    public Supermarket(double price) {
        this.setPrice(price);
    }

    /**
     * 计算总价方法
     */
    public double getTotalPrice(int num) {
        double totalPrice = this.price * num;
        return totalPrice;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }
}
